<?php

class Damages_Methods_Response_GetEmailTemplates extends Damages_Methods_Response {

  /**
   *
   * @var Damages_Methods_Data_EmailTemplate[] 
   */
  public $templates = array();

  /**
   *
   * @var Damages_Methods_Data_Email_Tag[] 
   */
  public $tags = array();

  public function setData() {
    $templates = DamagesEmailTemplatesQuery::create()->filterByLocked(0)->find();
    foreach ($templates as $template) {
      $this->templates[] = new Damages_Methods_Data_EmailTemplate($template);
    }

    foreach (Damages_Tags::getInstance()->getList() as $tag) {
      $this->tags[] = new Damages_Methods_Data_Email_Tag($tag);
    }
  }

}